﻿@inherits VocaDb.Web.Code.VocaDbPage

@{
	PageProperties.Title = "Statistics / Reports";
}

<select data-bind="foreach: categories, value: selectedReport" class="input-large">
	<optgroup label="NA" data-bind="attr: { label: name }, foreach: reports">
		<option data-bind="text: name, value: $data"></option>
	</optgroup>
</select>

<select data-bind="visible: showTimespanFilter, value: timespan">
	<option value="">Overall</option>
	<option value="24">Last day</option>
	<option value="48">Last two days</option>
	<option value="168">Last week</option>
	<option value="720">Last month</option>
	<option value="8760">Last year</option>
	<option value="17520">Last 2 years</option>
	<option value="26280">Last 3 years</option>
	<option value="43800">Last 5 years</option>
</select>

<div data-bind="highcharts: chartData"></div>

@section BodyScripts {
	<script src="https://code.highcharts.com/highcharts.js" type="text/javascript"></script>
	<script src="@Url.Content("~/Scripts/moment-with-locales.js")" type="text/javascript"></script>
	<script src="@Url.Content("~/Scripts/KnockoutExtensions/Highcharts.js")"></script>
	<script src="@Url.Content("~/Scripts/ViewModels/StatsViewModel.js")" type="text/javascript"></script>

	<script type="text/javascript">

		$(function () {
			var vm = new vdb.viewModels.StatsViewModel();
			ko.applyBindings(vm);
		});

	</script>

}
